<!doctype html>
<html  class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>后台登录</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" href="/web/res/css/login.css">
    <link rel="stylesheet" href="/web/res/css/xadmin.css">
    <script type="text/javascript" src="/web/res/js/jquery.min.js"></script>
    <script type="text/javascript" src="/web/res/layer/layer.js" charset="utf-8"></script>
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        .captcha-box{
            display: flex;
        }
    </style>
</head>
<body class="login-bg">

<div class="login layui-anim layui-anim-up">
    <div class="message">信息管理系统</div>
    <div id="darkbannerwrap"></div>
    <form method="post" action="/web/login.html" class="layui-form" id="userLogin" method="post">
        <input name="username" id="username" placeholder="用户名"  type="text" lay-verify="required" class="layui-input" value="system">
        <hr class="hr15">
        <input name="password" id="password" lay-verify="required" placeholder="密码"  type="password" class="layui-input" value="system">
        <hr class="hr15">
        <div style="display: flex;justify-content: space-between;">
            <input type="text" name="vercode" id="vercode" placeholder="请输入验证码" lay-verify="required" class="layui-input" style="width: 60% !important;">
            <img src="/web/kaptcha" onclick="this.src=this.src;" class="layadmin-user-login-codeimg" id="vercode_src">
        </div>
        <hr class="hr15">
        <input value="登录"  style="width:100%;" type="button" onclick="loginsubmit();" id="input1" />
        <hr class="hr20" >
    </form>
</div>
<script language="JavaScript">
    function keyLogin(){
     if (event.keyCode==13)  //回车键的键值为13
       document.getElementByIdx_x("input1").click(); //调用登录按钮的登录事件
    }
    </script>
<script type="text/javascript">
    <!-- 登录失败消息提示 -->
    <#if msg?default("")?trim?length gt 1>
        layer.msg('${msg!''}', {time: 3000, icon:5,offset: '30px'});
    </#if>

    function loginsubmit(){
        var userLogin = $("#userLogin");
        var username = $("#username").val();
        var password = $("#password").val();
        var vercode = $("#vercode").val();

        //判断表单数据是否为空!
        if(username.length<=0){
            layer.msg('用户名不能为空!', {time: 3000, icon:5,offset: '30px'});
            return ;
        }else if(password.length<=0){
            layer.msg('密码不能为空!', {time: 3000, icon:5,offset: '30px'});
            return ;
        }else if(vercode.length<=0){
            layer.msg('验证码不能为空!', {time: 3000, icon:5,offset: '30px'});
            return ;
        }else{
            userLogin.submit();
        }
    }

    document.onkeydown = function(){
        //解决火狐回车事件没作用
        var charCode=(navigator.appName=="Netscape")?event.which:event.keyCode;
        if(charCode==13){
            document.getElementById("btn_submit").click();
            return false;
        }
    };

    window.onload = function(){
        document.getElementById("loginname").focus();
    };

</script>
</body>
</html>